package com.lenovo.service.impl;

import java.util.List;
import javax.annotation.Resource;
import org.springframework.stereotype.Repository;

import com.lenovo.dao.BaseDAO;
import com.lenovo.model.GWeiboComment;
import com.lenovo.service.WeiboCommentService;

@Repository
public class WeiboCommentServiceImpl implements WeiboCommentService {

	@Resource
	private BaseDAO dao;

	@Override
	public List<GWeiboComment> browse() {
		return dao.listAll("GWeiboComment");
	}
	
	@Override
	public List<GWeiboComment> browse(int pageNo, int pageSize) {
		return dao.listAll("GWeiboComment", pageNo, pageSize);
	}

	@Override
	public GWeiboComment load(String id) {
		return (GWeiboComment) dao.loadById(GWeiboComment.class, id);
	}

	@Override
	public boolean del(String id) {
		boolean status = false;
		try {
			dao.delById(GWeiboComment.class, id);
			status = true;
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return status;
	}

	@Override
	public boolean save(GWeiboComment info) {
		boolean status = false;
		try {
			dao.save(info);
			status = true;
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return status;
	}

	@Override
	public boolean update(GWeiboComment info) {
		boolean status = false;
		try {
			dao.update(info);
			status = true;
		} catch (Exception ex) {
			ex.printStackTrace();
		}
		return status;
	}

}
